!include "MUI2.nsh"

Name "BabelPod"
OutFile "BabelPod-0.1.exe"
InstallDir $PROGRAMFILES\babelpod

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "license.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"

Section
    SetOutPath $INSTDIR
    
    File build\babelpod.exe
    File build\babelpod.dll
    File $%QT4DIR%\bin\qtcore4.dll
    File $%QT4DIR%\bin\qtgui4.dll
    File c:\windows\system32\MSVCP100.DLL
    File c:\windows\system32\MSVCR100.DLL
    
    WriteUninstaller $INSTDIR\uninstall.exe
    
    CreateDirectory "$SMPROGRAMS\BabelPod"
    CreateShortCut "$SMPROGRAMS\BabelPod\BabelPod.lnk" "$INSTDIR\babelpod.exe"
    CreateShortCut "$SMPROGRAMS\BabelPod\Uninstall BabelPod.lnk" "$INSTDIR\uninstall.exe"
    
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BabelPod" \
                "DisplayName" "BabelPod"
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BabelPod" \
                "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BabelPod" \
                "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
SectionEnd

Section "Uninstall"
    Delete $INSTDIR\uninstall.exe
    Delete $INSTDIR\babelpod.exe
    Delete $INSTDIR\babelpod.dll
    RMDir $INSTDIR
    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BabelPod"
SectionEnd